﻿<phone:PhoneApplicationPage 
    x:Class="FinanceCalculators.Views.HomeAffordability.HomeAffordability"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="HomeBuyerTools" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="Home Affordability" Margin="9,-7,0,0" FontSize="45"/>
        </StackPanel>
        <ScrollViewer  Grid.Row="1" Height="600" >
            <!--ContentPanel - place additional content here-->
            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Grid.Row="0" Name="tbGrossIncome" Text="Gross Income" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="1" Orientation="Horizontal" >
                    <TextBlock Text="$" FontSize="25" Width="40" Margin="10,20,0,0" />
                    <TextBox x:Name="txtGrossIncome" Text="4000" InputScope="TelephoneNumber" Width="280" Margin="10,0,0,0" Height="70" />
                    <toolkit:ListPicker x:Name="lstpicDuration" Width="113">
                        <ListBoxItem Content="yearly"></ListBoxItem>
                        <ListBoxItem Content="monthly"></ListBoxItem>
                        <ListBoxItem Content="weaklly"></ListBoxItem>
                        <ListBoxItem Content="hourly"></ListBoxItem>
                    </toolkit:ListPicker>
                </StackPanel>
                <TextBlock Grid.Row="2" Name="tbMinMonthlyDebtPayment" Text="Min Monthly Debt Payment" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="3" Orientation="Horizontal">
                <TextBlock Text="$" FontSize="25" Width="41" Margin="10,20,0,0" />
                    <TextBox  x:Name="txtMinMontlyDebtPayment" Text="300" InputScope="TelephoneNumber" Margin="10,0,0,0" Width="284" />
                </StackPanel>
                <TextBlock Grid.Row="4" Name="tbFundsAvailbleForHomePurchase" Text="Funds Availble For Home Purchase" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="5" Orientation="Horizontal">
                <TextBlock Text="$" FontSize="25" Width="41" Margin="10,20,0,0" />
                    <TextBox  x:Name="txtFundsAvailble" Text="20000" InputScope="TelephoneNumber" Width="280" Margin="10,0,0,0"  />
                </StackPanel>
                <TextBlock Grid.Row="6" Text="Mortgage Rate " HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="7" Orientation="Horizontal">
                    <TextBlock Text="$" FontSize="25" Width="41" Margin="10,20,0,0" />
                    <toolkit:ListPicker x:Name="lstpicMortage" ItemCountThreshold="3" ListPickerMode="Expanded" Margin="20,0,128,0" Width="259">
                    <toolkit:ListPicker.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <TextBlock Text="{Binding mtgPercentage}" Margin="0 0 0 0"/>
                            </StackPanel>
                        </DataTemplate>
                    </toolkit:ListPicker.ItemTemplate>
                    <toolkit:ListPicker.FullModeItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="16 21 0 20">
                                <TextBlock Text="{Binding mtgPercentage}" Margin="16 0 0 0" FontSize="32" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                            </StackPanel>
                        </DataTemplate>
                    </toolkit:ListPicker.FullModeItemTemplate>
                </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="-180,20,0,0" /> 
                </StackPanel>
                <TextBlock Grid.Row="9" Name="tbClosingCosts" Text="Closing Costs" HorizontalAlignment="Left" FontSize="25" Margin="0,20,0,0"/>
                <StackPanel Grid.Row="10" Orientation="Horizontal">
                    <toolkit:ListPicker x:Name="lstpikClosingCost" ItemCountThreshold="3" Margin="70,0,0,0" ListPickerMode="Expanded" Width="260">
                    <toolkit:ListPicker.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <TextBlock Text="{Binding clsCostPercentage}" Margin="0 0 0 0"/>
                            </StackPanel>
                        </DataTemplate>
                    </toolkit:ListPicker.ItemTemplate>
                    <toolkit:ListPicker.FullModeItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="16 21 0 20">
                                <TextBlock Text="{Binding clsCostPercentage}" Margin="16 0 0 0" FontSize="25" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                            </StackPanel>
                        </DataTemplate>
                    </toolkit:ListPicker.FullModeItemTemplate>
                </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="20,20,0,0" />
                </StackPanel>
                <TextBlock Grid.Row="11" Name="tbMinDownPayment" Text="Min Down Payment" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="12" Orientation="Horizontal">
                    <toolkit:ListPicker  x:Name="listmindownpayment" ItemCountThreshold="5" Margin="70,0,0,0" Width="260">
                        <ListBoxItem Content="0"></ListBoxItem>
                        <ListBoxItem Content="5"></ListBoxItem>
                        <ListBoxItem Content="10"></ListBoxItem>
                        <ListBoxItem Content="15"></ListBoxItem>
                        <ListBoxItem Content="20"></ListBoxItem>
                    </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="20,20,0,0" />
                </StackPanel>
                <TextBlock  Grid.Row="13" Name="tbPropertyTaxRate" Text="Property Tax Rate" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="14" Orientation="Horizontal">
                <toolkit:ListPicker  x:Name="lstpicPropertyTaxRate" ItemCountThreshold="5" Margin="70,0,0,0" Width="260">
                    <ListBoxItem Content="0.5"></ListBoxItem>
                    <ListBoxItem Content="0.75"></ListBoxItem>
                    <ListBoxItem Content="1"></ListBoxItem>
                    <ListBoxItem Content="15"></ListBoxItem>
                    <ListBoxItem Content="20"></ListBoxItem>
                </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="20,20,0,0" />
                </StackPanel>
                <TextBlock Grid.Row="15" Name="tbHazardInsurenceRate" Text="Hazard Insurence Rate" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="16" Orientation="Horizontal">
                    <toolkit:ListPicker  x:Name="lstpicHazardInsuranceRate" ItemCountThreshold="3" ListPickerMode="Expanded" Margin="70,0,0,0" Width="260" Height="65" >
                    <toolkit:ListPicker.ItemTemplate>
                        <DataTemplate >
                            <StackPanel>
                                <TextBlock Text="{Binding HazardInsuranceRate}" Margin="16,0,0,0" FontSize="25"/>
                            </StackPanel>
                        </DataTemplate>
                    </toolkit:ListPicker.ItemTemplate>
                    <toolkit:ListPicker.FullModeItemTemplate >
                        <DataTemplate>
                            <StackPanel >
                                <TextBlock Text="{Binding HazardInsuranceRate}" FontSize="25"/>
                            </StackPanel>
                        </DataTemplate>
                    </toolkit:ListPicker.FullModeItemTemplate>
                </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="20,20,0,0" />
                </StackPanel>
                <TextBlock Grid.Row="17" Name="tbPrivateMortageInsurence" Text="Private Mortage Insurence" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="18" Orientation="Horizontal">
                    <toolkit:ListPicker  x:Name="lstPicprivateMortageInsurance" Margin="70,0,0,0" Width="260">
                        <toolkit:ListPicker.ItemTemplate >
                            <DataTemplate >
                                <TextBlock Text="{Binding PrivateMortageInsura }"/>

                            </DataTemplate>
                        </toolkit:ListPicker.ItemTemplate>
                        <toolkit:ListPicker.FullModeItemTemplate>
                            <DataTemplate >
                                <TextBlock Text="{Binding PrivateMortageInsura}" Margin="16 0 0 0" FontSize="25"/>
                            </DataTemplate>
                        </toolkit:ListPicker.FullModeItemTemplate>
                    </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="20,20,0,0" />
                </StackPanel>
                <TextBlock Grid.Row="19" Name="tbHousingExpenseIncomeRatio" Text="Housing Expense Income Ratio" HorizontalAlignment="Left" FontSize="25"/>
                <StackPanel Grid.Row="20" Orientation="Horizontal">
                
                <toolkit:ListPicker  x:Name="lstpicHousingExpenseIncomeRatio" ItemCountThreshold="6" Margin="70,0,0,0" Width="260">
                    <toolkit:ListPicker.ItemTemplate>
                        <DataTemplate >
                            <TextBlock Text="{Binding HOusingExpensepercentages}"/>

                        </DataTemplate>
                    </toolkit:ListPicker.ItemTemplate>
                    <toolkit:ListPicker.FullModeItemTemplate>
                        <DataTemplate >
                            <TextBlock Text="{Binding HOusingExpensepercentages}"/>
                        </DataTemplate>
                    </toolkit:ListPicker.FullModeItemTemplate>
                </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="20,20,0,0" />
                </StackPanel>
                <TextBlock Grid.Row="21" Name="tbLongTermDebtIncomeRatio" Text="Long Term Debt Income Ratio" HorizontalAlignment="Left" FontSize="25" />
                <StackPanel Grid.Row="22" Orientation="Horizontal">
                    <toolkit:ListPicker  Height="56" x:Name="lstpicLongTermDebtIncomeRatio" ItemCountThreshold="5" Margin="70,0,0,0" Width="260">
                        <toolkit:ListPicker.ItemTemplate >
                            <DataTemplate >
                                <TextBlock Text="{Binding LongTermDebtpercentages }"/>

                            </DataTemplate>
                        </toolkit:ListPicker.ItemTemplate>
                        <toolkit:ListPicker.FullModeItemTemplate>
                            <DataTemplate >
                                <TextBlock Text="{Binding LongTermDebtpercentages}" Margin="16 0 0 0" FontSize="25"/>
                            </DataTemplate>
                        </toolkit:ListPicker.FullModeItemTemplate>
                    </toolkit:ListPicker>
                    <TextBlock Text="%" FontSize="25" Width="33" Margin="20,20,0,0" />
                </StackPanel>
                <!--<Button Grid.Row="23" x:Name="Btncalculator" Content="Calculate" HorizontalAlignment="Center" FontSize="36" Click="Btncalculator_Click_1"/>-->

            </Grid>
        </ScrollViewer>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/Calculator.png" Text="Calculate"/>
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>-->
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
